﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WPFStudy.Data;

namespace WPFStudy.View
{
    /// <summary>
    /// DataTemplateWindow.xaml 的交互逻辑
    /// </summary>
    public partial class DataTemplateWindow : Window
    {
        public DataTemplateWindow()
        {
            InitializeComponent();
            List<ListBoxDataModel> dataList = new List<ListBoxDataModel>()
            {
                new ListBoxDataModel()
                {
                    Name = "Red",
                    Description =  "红色",
                    ColorCode = "#FF0000",
                },
                new ListBoxDataModel()
                {
                    Name = "Green",
                    Description =  "绿色",
                    ColorCode = "#00FF00",
                },
                new ListBoxDataModel()
                {
                    Name = "Blue",
                    Description =  "蓝色",
                    ColorCode = "#0000FF",
                }
            };
            list.ItemsSource = dataList;
            dataGrid.ItemsSource = dataList;
        }
    }
}
